package com.boot.sample.starter.config;


import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ToolConfig {
    @Bean
    @ConditionalOnProperty(name="take.tool",havingValue = "car")
    public OneToOne byCar(){
        return new DriveCar();
    }

    @Bean
    @ConditionalOnProperty(name="take.tool",havingValue = "fly")
    public OneToOne byFly(){
        return new TakeFly();
    }
}
